#!/bin/bash
# export_tdengine.sh
# 导出一个 TDengine 一个数据库某一日的数据

# ./export_tdengine.sh iot_ts 20231010 /opt/ems/data/archive/iot_ts/iot_ts_20231010_data_properties_e_modbus_201000001.csv

# username=$1
# password=$2
# db=$3
# table=$4
# pk=$5
# date=$6
# file=$7

# 限制只能在测试环境的主机上执行  
if [ "$(hostname)" != "ecs-377e-1103456" ];then
    echo "ERR: 【导入脚本】只能在【测试环境】运行，不能在生产环境运行!!!"
    exit 1  
fi


#/opt/ems/bin/export_tdengine.sh "root" "FeO#BuV&L6HC" "iot_ts" "properties_e_modbus_201000001" "_ts" "2023-10-10" "/opt/ems/data/archive/iot_ts/iot_ts_20231010_data_properties_e_modbus_201000001.csv"